package com.wc.alorithm_blue_bridge._思维.Q3791;
import java.io.*;
/**
 * @Author congege
 * @Description
 * 珠宝最大交替和
 * https://www.lanqiao.cn/problems/3791/learning/?page=1&first_category_id=1
 * @Date Created in 2023/11/23-21:38
 */
public class Main {
    public static void main(String[] args) {
        Input sc = new Input();
        long sum = 0;
        // 最大的负数
        int maxNeg = -1;
        // 最小的正数
        int minPos = Integer.MAX_VALUE;
        // 判断当前符号
        long flg = 1;
        int n = sc.nextInt();

        while(n-->0){
            int num = Math.abs(sc.nextInt());
            sum += flg * num;
            if(flg == 1){
                minPos = Math.min(minPos,num);
            } else {
                maxNeg = Math.max(maxNeg,num);
            }
            flg = -flg;
        }
        // 判断要是最小的正数，比最大的负数还大，那就不用交换了，也就不需要增益了
        if(minPos < maxNeg){
            sum += 2L * maxNeg;
            sum -= 2L * minPos;
        }
        System.out.println(sum);
    }

    static class Input{
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public int nextInt(){
            try{
                in.nextToken();
            }catch(Exception e){
                return -1;
            }
            return (int) in.nval;
        }
    }
}
